﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp3
{
    public partial class RegisterForm : Form
    {
        public RegisterForm()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            var uid = userName.Text;
            var pwd = PassWord.Text;
            var rPwd= reTrypassWord.Text;
            var isUidNull = string.IsNullOrEmpty(uid);
            var isPwdNull =string . IsNullOrEmpty(pwd);
            var isEqure = pwd == rPwd;
            if (!isUidNull&&! isPwdNull&& isEqure)
            {
                MessageBox.Show("恭喜注册成功");
                Form1._user.Add(uid, pwd);
                this.Close();

            }
            else
            {
                MessageBox.Show("注册失败");
            }
        }

        private void label3_Click(object sender, EventArgs e)
        {

        }

        private void RegisterForm_Load(object sender, EventArgs e)
        {

        }

        private void reTrypassWord_TextChanged(object sender, EventArgs e)
        {

        }

        private void PassWord_TextChanged(object sender, EventArgs e)
        {

        }

        private void userName_TextChanged(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }
    }
}
